/**
 * Get the first regular expression match
 *
 * @name: getFirstMatch
 * @author: luoluo
 * @date: 2007-01-01
 * @version: 1.0
 *
 * @param{re}: Regular expression object.
 * @param{s}: String to be matched.
 * @param{i}: Index of sub matches.
 * 
 * @return: It returen the specefied sub match of first match.
 * @sample:
 *
 * alert(getFirstMatch(/a=(\d+)/, "&a=123&b=xx", 1)); 
 *
 */
function getFirstMatch(re, s, i) {
	var m = null;
	if ((m = re.exec(s)) != null) {
		return m[i];
	}
}